def move(src: list[int], tar: list[int]) -> None:
    """将柱子src的最后一个元素移动到柱子tar的末尾"""
    if src:
        tar.append(src.pop())

def f(n, src, tem, tar):
    if n == 1:
        move(src, tar)
        return f'{src} {tem} {tar}\n'
    f(n - 1, src, tem, tar)
    move(src, tar)
    f(n - 1, tem, src, tar)







def hanoi_solver(disk_num: int) -> str:
    # 3 disks
    rod1 = list(range(disk_num, 0, -1))
    tem = [] 
    rod3 = []
    print(rod1, tem, rod3)
    # step 1
    rod3.append(rod1.pop())
    print(rod1, tem, rod3)
    # step 2
    tem.append(rod1.pop())
    print(rod1, tem, rod3)
    # step 3
    tem.append(rod3.pop())
    print(rod1, tem, rod3)
    # step 4
    rod3.append(rod1.pop())
    print(rod1, tem, rod3)
    # step 5
    rod1.append(tem.pop())
    print(rod1, tem, rod3)
    # step 6
    rod3.append(tem.pop())
    print(rod1, tem, rod3)
    # final step
    rod3.append(rod1.pop())
    print(rod1, tem, rod3)

    return


if __name__ == '__main__':
    hanoi_solver(3)